package com.huitone.gddw.service.dto;

import java.util.Date;

import com.huitone.gddw.common.excel.ColToProperty;
import com.huitone.gddw.common.excel.TabCol;
import com.huitone.gddw.dao.entity.UploadFile;
import com.huitone.gddw.utils.DateTimeUtils;

/**
 * 黑名单用户 DTO 对象
 * @author wuluodan
 *
 */
public class UploadFileDTO {

	@ColToProperty
	@TabCol(Index = 1, title = "序号", width = "")
	private Integer seq;
	
	private String fileId;
	
	@ColToProperty
	@TabCol(Index = 2, title = "日期", width = "65")
	private String uptimeDate;
	
	@ColToProperty
	@TabCol(Index = 3, title = "导入文件名", width = "120")
	private String fileName;
	
	@ColToProperty
	@TabCol(Index = 4, title = "文件类型", width = "")
	private String fileType;
	
	@ColToProperty
	@TabCol(Index = 5, title = "文件格式", width = "")
	private String fileFormat;
	
	@ColToProperty
	@TabCol(Index = 6, title = "导入成功记录", width = "75")
	private Integer okLines;

	@ColToProperty
	@TabCol(Index = 7, title = "导入失败记录", width = "75")
    private Integer failLines;
    
    private String userId;
    
    @ColToProperty
	@TabCol(Index = 8, title = "导入操作人", width = "65")
    private String userName;
    
    @ColToProperty
	@TabCol(Index = 9, title = "操作时间", width = "130")
    private Date uptime;
    
    private String auditStatus;
    
    @ColToProperty
	@TabCol(Index = 10, title = "状态", width = "")
    private String auditStatusStr;
    
    private String status;
    
    public UploadFileDTO() {}
    
    public UploadFileDTO(UploadFile entity) {
    	this.setFileId(entity.getFileId());
    	this.setFileName(entity.getFileName());
    	this.setFileType(entity.getFileType());
    	this.setFileFormat(entity.getFileFormat());
    	this.setOkLines(entity.getOkLines());
    	this.setFailLines(entity.getFailLines());
    	this.setUserId(entity.getUserId());
    	this.setUptime(entity.getUptime());
    	this.setAuditStatus(entity.getAuditStatus());
    	this.setStatus(entity.getStatus());
    }

	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public String getFileId() {
		return fileId;
	}

	public void setFileId(String fileId) {
		this.fileId = fileId;
	}

	public String getUptimeDate() {
		return DateTimeUtils.dateToStr(this.uptime, "yyyy-MM-dd");
	}

	public void setUptimeDate(String uptimeDate) {
		this.uptimeDate = uptimeDate;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getFileType() {
		return fileType;
	}

	public void setFileType(String fileType) {
		this.fileType = fileType;
	}

	public String getFileFormat() {
		return fileFormat;
	}

	public void setFileFormat(String fileFormat) {
		this.fileFormat = fileFormat;
	}

	public Integer getOkLines() {
		return okLines;
	}

	public void setOkLines(Integer okLines) {
		this.okLines = okLines;
	}

	public Integer getFailLines() {
		return failLines;
	}

	public void setFailLines(Integer failLines) {
		this.failLines = failLines;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Date getUptime() {
		return uptime;
	}

	public void setUptime(Date uptime) {
		this.uptime = uptime;
	}

	public String getAuditStatus() {
		return auditStatus;
	}

	public void setAuditStatus(String auditStatus) {
		this.auditStatus = auditStatus;
	}

	public String getAuditStatusStr() {
		if (null == this.auditStatus) {
			return "未知";
		}
		if (this.auditStatus.equals("0")) {
			return "待审核";
		}
		if (this.auditStatus.equals("1")) {
			return "审核通过";
		}
		if (this.auditStatus.equals("2")) {
			return "审核不通过";
		}
		return "未知";
	}

	public void setAuditStatusStr(String auditStatusStr) {
		this.auditStatusStr = auditStatusStr;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
}
